package com.cqie.hospitalescort.entity;

import com.baomidou.mybatisplus.annotation.*;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;

import com.cqie.hospitalescort.DTO.ChatInfoDTO;
import com.cqie.hospitalescort.message.ChatMessage;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import org.springframework.beans.BeanUtils;

import javax.validation.constraints.NotNull;

/**
 * <p>
 * 
 * </p>
 *
 * @author gdy
 * @since 2025-02-18
 */
@Getter
@Setter
@TableName("online_chat_info")
@ApiModel(value = "OnlineChatInfo对象", description = "")
public class OnlineChatInfo implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty("id")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @ApiModelProperty("聊天编号")
    private String chatCode;

    @ApiModelProperty("用户id")
    private Long userId;

    @ApiModelProperty("陪诊人员id")
    private Long escortId;

    @ApiModelProperty("信息内容")
    private String comment;

    @ApiModelProperty("发送者类型：0-USER-用户, 1-ESCORT-陪诊员")
    private String senderType;

    @ApiModelProperty("创建时间")
    @TableField(fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    @ApiModelProperty("逻辑删除")
//    @TableLogic
    private Integer deleteFlag;

    public ChatInfoDTO toChatInfoDTO() {
        ChatInfoDTO chatInfoDTO = new ChatInfoDTO();
        BeanUtils.copyProperties(this, chatInfoDTO);
        return chatInfoDTO;
    }


}
